// This do-file extracts data on unemployment from the ILO

use "$project_path/data/1_input/outcomes/ilo/UNE_2EAP_SEX_AGE_RT_A.dta", clear

//We use the 15+ definition, for which the most data is available
keep if classif1_label=="Age (Youth, adults): 15+"
keep ref_area_label time obs_value
ren ref_area_label Country
ren time Year
ren obs_value unemployment_ilo

destring Year, replace

replace Country="Bosnia-Herz"  if Country=="Bosnia and Herzegovina"
replace Country="Brunei"  if Country=="Brunei Darussalam"
replace Country="C. Verde Is."  if Country=="Cape Verde"
replace Country="Cent. Af. Rep."  if Country=="Central African Republic"
replace Country="PRC"  if Country=="China"
replace Country="Comoro Is."  if Country=="Comoros"
replace Country="Congo (DRC)"  if Country=="Congo, Democratic Republic of the"
replace Country="Czech Rep."  if Country=="Czechia"
replace Country="Ivory Coast"  if Country=="Côte d'Ivoire"
replace Country="Dom. Rep."  if Country=="Dominican Republic"
replace Country="Eq. Guinea"  if Country=="Equatorial Guinea"
replace Country="Swaziland"  if Country=="Eswatini"
replace Country="FRG/Germany"  if Country=="Germany"
replace Country="Iran"  if Country=="Iran, Islamic Republic of"
replace Country="PRK"  if Country=="Korea, Democratic People's Republic of"
replace Country="Laos"  if Country=="Lao People's Democratic Republic"
replace Country="Moldova"  if Country=="Moldova, Republic of"
replace Country="Macedonia"  if Country=="North Macedonia"
replace Country="Occupied Palestinian Territories"  if Country=="Occupied Palestinian Territory"
replace Country="P. N. Guinea"  if Country=="Papua New Guinea"
replace Country="Russia"  if Country=="Russian Federation"
replace Country="St. Lucia"  if Country=="Saint Lucia"
replace Country="Saint Vincent and The Grenadines"  if Country=="Saint Vincent and the Grenadines"
replace Country="Solomon Is."  if Country=="Solomon Islands"
replace Country="S. Africa"  if Country=="South Africa"
replace Country="Syria"  if Country=="Syrian Arab Republic"
replace Country="Taiwan"  if Country=="Taiwan, China"
replace Country="Tanzania"  if Country=="Tanzania, United Republic of"
replace Country="Trinidad-Tobago"  if Country=="Trinidad and Tobago"
replace Country="UAE"  if Country=="United Arab Emirates"
replace Country="UK"  if Country=="United Kingdom"
replace Country="USA"  if Country=="United States"
replace Country="Venezuela"  if Country=="Venezuela, Bolivarian Republic of"
replace Country="Vietnam"  if Country=="Viet Nam"
drop if Country=="ASEAN"
drop if Country=="Africa"
drop if Country=="Africa: Low income"
drop if Country=="Africa: Lower-middle income"
drop if Country=="Africa: Upper-middle income"
drop if Country=="Americas"
drop if Country=="Americas: High income"
drop if Country=="Americas: Lower-middle income"
drop if Country=="Americas: Upper-middle income"
drop if Country=="Arab League"
drop if Country=="Arab States"
drop if Country=="Arab States: High income"
drop if Country=="Arab States: Low income"
drop if Country=="Arab States: Lower-middle income"
drop if Country=="Arab States: Upper-middle income"
drop if Country=="Asia and the Pacific"
drop if Country=="Asia and the Pacific: High income"
drop if Country=="Asia and the Pacific: Low income"
drop if Country=="Asia and the Pacific: Lower-middle income"
drop if Country=="Asia and the Pacific: Upper-middle income"
drop if Country=="BRICS"
drop if Country=="CARICOM"
drop if Country=="Caribbean"
drop if Country=="Central Africa"
drop if Country=="Central America"
drop if Country=="Central Asia"
drop if Country=="Central and Western Asia"
drop if Country=="Central and Western Asia: High income"
drop if Country=="Central and Western Asia: Lower-middle income"
drop if Country=="Central and Western Asia: Upper-middle income"
drop if Country=="Channel Islands"
drop if Country=="Eastern Africa"
drop if Country=="Eastern Asia"
drop if Country=="Eastern Asia: High income"
drop if Country=="Eastern Asia: Low income"
drop if Country=="Eastern Asia: Lower-middle income"
drop if Country=="Eastern Asia: Upper-middle income"
drop if Country=="Eastern Europe"
drop if Country=="Eastern Europe: High income"
drop if Country=="Eastern Europe: Lower-middle income"
drop if Country=="Eastern Europe: Upper-middle income"
drop if Country=="Europe and Central Asia"
drop if Country=="Europe and Central Asia: High income"
drop if Country=="Europe and Central Asia: Lower-middle income"
drop if Country=="Europe and Central Asia: Upper-middle income"
drop if Country=="European Union 27"
drop if Country=="European Union 28"
drop if Country=="French Polynesia"
drop if Country=="G20"
drop if Country=="G7"
drop if Country=="Guam"
drop if Country=="Hong Kong, China"
drop if Country=="Latin America and the Caribbean"
drop if Country=="Latin America and the Caribbean: High income"
drop if Country=="Latin America and the Caribbean: Lower-middle income"
drop if Country=="Latin America and the Caribbean: Upper-middle income"
drop if Country=="MENA"
drop if Country=="Macau, China"
drop if Country=="New Caledonia"
drop if Country=="Northern Africa"
drop if Country=="Northern Africa: Low income"
drop if Country=="Northern Africa: Lower-middle income"
drop if Country=="Northern Africa: Upper-middle income"
drop if Country=="Northern America"
drop if Country=="Northern America: High income"
drop if Country=="Northern Europe"
drop if Country=="Northern, Southern and Western Europe"
drop if Country=="Northern, Southern and Western Europe: High income"
drop if Country=="Northern, Southern and Western Europe: Upper-middle income"
drop if Country=="Pacific Islands"
drop if Country=="South America"
drop if Country=="South-Eastern Asia"
drop if Country=="South-Eastern Asia and the Pacific"
drop if Country=="South-Eastern Asia and the Pacific: High income"
drop if Country=="South-Eastern Asia and the Pacific: Lower-middle income"
drop if Country=="South-Eastern Asia and the Pacific: Upper-middle income"
drop if Country=="Southern Africa"
drop if Country=="Southern Asia"
drop if Country=="Southern Asia: Low income"
drop if Country=="Southern Asia: Lower-middle income"
drop if Country=="Southern Asia: Upper-middle income"
drop if Country=="Southern Europe"
drop if Country=="Sub-Saharan Africa"
drop if Country=="Sub-Saharan Africa: Low income"
drop if Country=="Sub-Saharan Africa: Lower-middle income"
drop if Country=="Sub-Saharan Africa: Upper-middle income"
drop if Country=="United States Virgin Islands"
drop if Country=="Western Africa"
drop if Country=="Western Asia"
drop if Country=="Western Europe"
drop if Country=="Western Sahara"
drop if Country=="World"
drop if Country=="World excluding BRICS"
drop if Country=="World: High income"
drop if Country=="World: Low income"
drop if Country=="World: Lower-middle income"
drop if Country=="World: Upper-middle income"

lab var unemployment_ilo "Unemployment rate"

notes unemployment_ilo : Source - ILO

save "$project_path/data/2_intermediary/outcomes/outcomes_ilo.dta", replace

